#ifndef __AFXCOLL_H__
#define __AFXCOLL_H__
#include "_afxwin.h"
#include "_AFXPLEX_.H"

class CMapPtrToPtr
{
protected:
	struct CAssoc
	{
		CAssoc* pNext;
		void* key;
		void* value;
	};
public:
	CMapPtrToPtr(int nBlockSize = 10);
	int GetCount() const;
	BOOL IsEmpty() const;
	BOOL Lookup(void* key,void* &value);
	void*& operator[](void* key);
	void SetAt(void* key,void* newValue);
	void RemoveAll();
	BOOL RemoveKey(void* key);
	UINT GetHashTableSize() const;
	void InitHashTable(UINT nHashSize,BOOL bAllocNow=TRUE);
	UINT HashKey(void* key) const;



protected:
	CAssoc** m_pHashTable;
	int m_nHashTableSize;
	 CPlex* m_pBlocks;
	 int m_nBlockSize;
	 CAssoc* m_pFreeList;
	 int m_nCount;
	 CAssoc* NewAssoc();
	 void FreeAssoc(CAssoc* pAssoc);
	 CAssoc* GetAssocAt(void* key,UINT &nHash) const;
public:
	~CMapPtrToPtr();
};
#endif